﻿<%@ Page Language="C#" MasterPageFile="~/Shared/MainPage.Master" StylesheetTheme="GlobleTheme" AutoEventWireup="true" CodeBehind="ContractItemListPutView.aspx.cs" Inherits="Runda.CMS.Portal.ContractManage.ContractItemListPutView" Title="Untitled Page" %>

<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <script src="../Content/global.js" type="text/javascript"></script>
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Tab/tabs.css" rel="stylesheet" type="text/css" />
    
    <script type="text/javascript">
        function SelectInstrument() {
            var returnValue = openStdDlg("SelectContractItemInstrument.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "", 800, 600);
            RefreshItems();
        }

        function SelectSubInstrument() {
            if (document.getElementById('<%=txtItemID.ClientID %>').value == "") {
                alert('请选择机器!!'); return;
            }
            var returnValue = openStdDlg("SelectContractSubItemInstrument.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value + "&ItemID=" + document.getElementById('<%=txtItemID.ClientID %>').value, "", 800, 600);
            RefreshSubItem();
        }
        
        function RefreshItems() {
            document.getElementById('<%=btnRefresh.ClientID %>').click();
        }

        function RowSelected(rowObject) {
            document.getElementById("<%=txtItemType.ClientID %>").value = rowObject.KeyValues["Type"];
            document.getElementById("<%=txtItemID.ClientID %>").value = rowObject.KeyValues["ItemID"];
          
            RefreshSubItem();
            //RefreshGuaranty();
            //RefreshItemPart();
        }

        function AddGuaranty() {
            if (document.getElementById("<%=txtItemType.ClientID %>").value != "2") {
                alert('请选择机器!');
                return;
            }
            if (document.getElementById('<%=txtItemID.ClientID %>').value == "") {
                alert('请选择机器!!'); return;
            }
            var returnValue = openStdDlg("ItemGuarantyAdd.aspx?ItemID=" + document.getElementById('<%=txtItemID.ClientID %>').value, "", 600, 500);

            //RefreshGuaranty();
        }   

        function RefreshSubItem() {
            if (document.getElementById('<%=txtItemID.ClientID %>').value == "") {
                alert('请选择机器!!'); return;
            }
            document.getElementById('<%=btnRefreshSubItem.ClientID %>').click();
        }

        function radtxtMachinePeriod_OnClientValueChanged(sender, args) {
            //alert(sender.ClientID + ".OnClientValueChanged: Value is changed to " + Math.round(args.NewValue));
            document.getElementById('ctl00_cphBody_radtxtMachineTotalIncome_Text').value = document.getElementById('ctl00_cphBody_radtxtMachinePerIncome_Text').value * 1 * Math.round(args.NewValue);
            document.getElementById('ctl00_cphBody_radtxtMachineTotalIncome_Value').value = document.getElementById('ctl00_cphBody_radtxtMachinePerIncome_Value').value * 1 * Math.round(args.NewValue);
        }

        function radtxtMachinePerIncome_OnClientValueChanged(sender, args) {
            document.getElementById('ctl00_cphBody_radtxtMachineTotalIncome_Text').value = document.getElementById('ctl00_cphBody_radtxtMachinePeriod_Text').value * 1 * (args.NewValue);
            document.getElementById('ctl00_cphBody_radtxtMachineTotalIncome_Value').value = document.getElementById('ctl00_cphBody_radtxtMachinePeriod_Value').value * 1 * (args.NewValue);
        }

        function radtxtMaintainPeriod_OnClientValueChanged(sender, args) {
            //alert(sender.ClientID + ".OnClientValueChanged: Value is changed to " + Math.round(args.NewValue));
            document.getElementById('ctl00_cphBody_radtxtMaintainTotalIncome_Text').value = document.getElementById('ctl00_cphBody_radtxtMaintainPerIncome_Text').value * 1 * Math.round(args.NewValue);
            document.getElementById('ctl00_cphBody_radtxtMaintainTotalIncome_Value').value = document.getElementById('ctl00_cphBody_radtxtMaintainPerIncome_Value').value * 1 * Math.round(args.NewValue);
        }

        function radtxtMaintainPerIncome_OnClientValueChanged(sender, args) {
            document.getElementById('ctl00_cphBody_radtxtMaintainTotalIncome_Text').value = document.getElementById('ctl00_cphBody_radtxtMaintainPeriod_Text').value * 1 * (args.NewValue);
            document.getElementById('ctl00_cphBody_radtxtMaintainTotalIncome_Value').value = document.getElementById('ctl00_cphBody_radtxtMaintainPeriod_Value').value * 1 * (args.NewValue);
        }
        
        function radtxtRentPeriod_OnClientValueChanged(sender, args) {
            //alert(sender.ClientID + ".OnClientValueChanged: Value is changed to " + Math.round(args.NewValue));
            document.getElementById('ctl00_cphBody_radtxtRentTotalIncome_Text').value = document.getElementById('ctl00_cphBody_radtxtRentPerIncome_Text').value * 1 * Math.round(args.NewValue);
            document.getElementById('ctl00_cphBody_radtxtRentTotalIncome_Value').value = document.getElementById('ctl00_cphBody_radtxtRentPerIncome_Value').value * 1 * Math.round(args.NewValue);
        }

        function radtxtRentPerIncome_OnClientValueChanged(sender, args) {
            document.getElementById('ctl00_cphBody_radtxtRentTotalIncome_Text').value = document.getElementById('ctl00_cphBody_radtxtRentPeriod_Text').value * 1 * (args.NewValue);
            document.getElementById('ctl00_cphBody_radtxtRentTotalIncome_Value').value = document.getElementById('ctl00_cphBody_radtxtRentPeriod_Value').value * 1 * (args.NewValue);
        }

        function RefreshItemPart() { 
            document.getElementById('<%=btnResreshItemPart.ClientID %>').click();
        }

        function SelectParts() {
            if (document.getElementById('<%=txtItemID.ClientID %>').value == "") {
                alert('请先选择器械!!'); return;
            }
            var returnValue = openStdDlg("SelectContractItemPart.aspx?ItemID=" + document.getElementById('<%=txtItemID.ClientID %>').value, "", 800, 600);
            RefreshItemPart();
        }

        function SelecContractGift() {

            if (document.getElementById('<%=txtContractID.ClientID %>').value == "") {
                alert('请先保存合同信息!'); return;
            }
            var returnValue = openStdDlg("SelectGift.aspx?ContractID=" + document.getElementById('<%=txtContractID.ClientID %>').value, "", 800, 600);

            RefreshContractGift();
        }

        function RefreshContractGift() {
            if (document.getElementById('<%=txtContractID.ClientID %>').value == "") {
                alert('请先保存合同信息!!'); return;
            }
            document.getElementById('<%=btnRefreshContractGift.ClientID %>').click();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="server">
   <rad:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <rad:AjaxSetting AjaxControlID="gridContractItems">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="gridSubItems" />
                    <rad:AjaxUpdatedControl ControlID="txtItemID" />
                    <rad:AjaxUpdatedControl ControlID="txtItemType" /> 
                </UpdatedControls>
            </rad:AjaxSetting>   
             <rad:AjaxSetting AjaxControlID="btnRefreshSubItem">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="gridSubItems" LoadingPanelID="AjaxLoadingPanel"/>
                </UpdatedControls>
            </rad:AjaxSetting> 
             <rad:AjaxSetting AjaxControlID="btnRefresh">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="gridContractItems" />
                </UpdatedControls>
            </rad:AjaxSetting>
            
            <rad:AjaxSetting AjaxControlID="ddlPaymentType">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="ddlPaymentPeroid" />             
                </UpdatedControls>
            </rad:AjaxSetting>
             <rad:AjaxSetting AjaxControlID="ddlPaymentPeroid">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="gridPayment" LoadingPanelID="AjaxLoadingPanel"/>                
                </UpdatedControls>
            </rad:AjaxSetting>
            
            <rad:AjaxSetting AjaxControlID="btnSavePayment">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="gridPayment" LoadingPanelID="AjaxLoadingPanel"/>     
                    <rad:AjaxUpdatedControl ControlID="ddlPaymentType" />        
                    <rad:AjaxUpdatedControl ControlID="ddlPaymentPeroid" />                   
                </UpdatedControls>
            </rad:AjaxSetting>
            <rad:AjaxSetting AjaxControlID="btnSaveIncome">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="divContractOthor" LoadingPanelID="AjaxLoadingPanel" />
                </UpdatedControls>
            </rad:AjaxSetting>
            
            <rad:AjaxSetting AjaxControlID="btnRefreshContractGift">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="gridContractGift" LoadingPanelID="AjaxLoadingPanel" />
                </UpdatedControls>
            </rad:AjaxSetting> 
            <rad:AjaxSetting AjaxControlID="btnResreshItemPart">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="gridContractItemPart" LoadingPanelID="AjaxLoadingPanel" />
                </UpdatedControls>
            </rad:AjaxSetting>
        </AjaxSettings>
    </rad:RadAjaxManager>
    
    <rad:AjaxLoadingPanel runat="server" ID="AjaxLoadingPanel">
        <img src="../Images/loadding_orange.gif" /> 加载中...
    </rad:AjaxLoadingPanel>
 <div class="area" id="areaForm" >
                    
    <div style="margin: 5px 0 5px 0">
    </div>
    <table class="mnubar" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td style="padding-left: 5px" nowrap>
                    <b>合同明细项</b>
                </td>
                <td style="padding-left: 5px">
                    <img src="../Content/Grid/separator.gif">
                </td>
                <td class="icMenu" nowrap> 
                </td>
                <td class="icMenu mnuRight" nowrap>
                     <span class="menu"  onclick="return RefreshItems();">
                            <img class="mnuBtn" src="../Images/16_L_refresh.gif"><span class="mnuBtn">刷新</span></span> 
                </td>
            </tr>
        </tbody>
    </table>
    <rad:RadGrid runat="server" ID="gridContractItems" Skin="OCM" AutoGenerateColumns="False" AllowSorting="True" GridLines="None" OnItemCommand="gridContractItems_ItemCommand"
         OnSortCommand="gridContractItems_SortCommand" OnItemDataBound="gridContractItems_ItemDataBound" EnableAJAX="True" EnableAJAXLoadingTemplate="True">
        <AJAXLoadingTemplate>
        <img src="../Images/loadding_orange.gif" /> 加载中...
        </AJAXLoadingTemplate>
        <ClientSettings EnableClientKeyValues="true">
            <Selecting AllowRowSelect="true" />
            <ClientEvents OnRowSelected="RowSelected" />
        </ClientSettings>
        <MasterTableView DataKeyNames="ItemID,Type"> 
            <Columns>
                <rad:GridBoundColumn DataField="InstrumentCode" HeaderText="编码">
                </rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="InstrumentName" HeaderText="名称"></rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="ItemStandard" HeaderText="规格"></rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="unit" HeaderText="单位"></rad:GridBoundColumn> 
                 <rad:GridTemplateColumn HeaderText="数量">
                    <ItemTemplate>
                        <asp:TextBox ID="txtCount" runat="server" Width="60px" CssClass="input" Text='<%#Eval("Count") %>'></asp:TextBox>
                     </ItemTemplate>
                </rad:GridTemplateColumn>
                  <rad:GridTemplateColumn HeaderText="保修年份">
                    <ItemTemplate>
                        <asp:TextBox ID="txtGuaranteeYear" runat="server" Width="60px" CssClass="input" Text='<%#Eval("GuaranteeYear") %>'></asp:TextBox>
                    </ItemTemplate>
                </rad:GridTemplateColumn>              
                  <rad:GridTemplateColumn HeaderText="租赁年限" Visible="false">
                    <ItemTemplate>
                        <asp:TextBox ID="txtLeasingRestrict" runat="server" Width="60px" CssClass="input" Text='<%#Eval("LeasingRestrict") %>'></asp:TextBox>
                    </ItemTemplate>
                </rad:GridTemplateColumn>
                <rad:GridTemplateColumn HeaderText="租赁费" Visible="false">
                  <ItemTemplate>
                      <asp:TextBox ID="txtLeasingPrice" runat="server" Width="60px" CssClass="input" Text='<%#Eval("LeasingPrice") %>'></asp:TextBox>
                  </ItemTemplate>
                </rad:GridTemplateColumn>
                 <rad:GridTemplateColumn HeaderText="每年承诺试剂销售额">
                  <ItemTemplate>
                      <asp:TextBox ID="txtPromiseRevenue" runat="server" Width="80px" CssClass="input" Text='<%#Eval("PromiseRevenue") %>'></asp:TextBox>
                  </ItemTemplate>
                </rad:GridTemplateColumn>
                 <rad:GridTemplateColumn HeaderText="投放年限">
                    <ItemTemplate>
                        <asp:TextBox ID="txtPutPeriod" runat="server" Width="60px" CssClass="input" Text='<%#Eval("PutPeriod") %>'></asp:TextBox>
                    </ItemTemplate>
                </rad:GridTemplateColumn>
                <rad:GridTemplateColumn HeaderText="操作" Visible="false">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkbtnSave" runat="server" Text="保存" CommandName="save"></asp:LinkButton>
                     </ItemTemplate>
                </rad:GridTemplateColumn>
                <rad:GridButtonColumn CommandName="delete" Text="删除" Visible="false">
                </rad:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </rad:RadGrid>
    <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
    </div>
      
    <div style="margin: 5px 0 5px 0">
    </div>
    <table class="mnubar" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td style="padding-left: 5px" nowrap>
                    <b>机器配套试剂</b>
                </td>
                <td style="padding-left: 5px">
                    <img src="../Content/Grid/separator.gif">
                </td>
                <td class="icMenu" nowrap> 
                </td>
                <td class="icMenu mnuRight" nowrap>
                     <span class="menu"  onclick="return RefreshSubItem();">
                            <img class="mnuBtn" src="../Images/16_L_refresh.gif"><span class="mnuBtn">刷新</span></span> 
                </td>
            </tr>
        </tbody>
    </table>
     <div>
    <table width="100%">
        <tr><td>折扣：</td><td>
            <rad:RadNumericTextBox ID="radtxtPutDiscount" runat="server">
            </rad:RadNumericTextBox></td><td>付款形式：</td><td>
            <asp:DropDownList ID="ddlPutPaymentType" runat="server" Width="150px">
            </asp:DropDownList>
        </td>
        </tr>
    </table>
    </div>
    <rad:RadGrid runat="server" ID="gridSubItems" Skin="OCM" AutoGenerateColumns="False" AllowSorting="false" GridLines="None" EnableAJAX="true" EnableAJAXLoadingTemplate="True"
         OnItemCommand="gridSubItems_ItemCommand">
       <AJAXLoadingTemplate>
       <img src="../Images/loadding_orange.gif" /> 加载中...
        </AJAXLoadingTemplate>
        <MasterTableView DataKeyNames="ItemID"> 
            <Columns>
                <rad:GridBoundColumn DataField="InstrumentCode" HeaderText="编码">
                </rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="InstrumentName" HeaderText="名称"></rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="ItemStandard" HeaderText="规格"></rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="unit" HeaderText="单位"></rad:GridBoundColumn> 
                 <rad:GridTemplateColumn HeaderText="数量">
                    <ItemTemplate>
                        <asp:TextBox ID="txtCount" runat="server" Width="60px" CssClass="input" Text='<%#Eval("Count") %>'></asp:TextBox>
                     </ItemTemplate>
                </rad:GridTemplateColumn>
                   <rad:GridTemplateColumn HeaderText="销售价">
                    <ItemTemplate>
                        <asp:TextBox ID="txtPrice" runat="server" Width="60px" CssClass="input" Text='<%#Eval("Price") %>'></asp:TextBox>
                     </ItemTemplate>
                </rad:GridTemplateColumn>
                <rad:GridBoundColumn DataField="PutDiscountPrice" HeaderText="折扣价" DataFormatString="{0:N}"></rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="TotalPrice" HeaderText="总价"></rad:GridBoundColumn>
                <rad:GridTemplateColumn HeaderText="操作" Visible="false">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkbtnSave" runat="server" Text="保存" CommandName="save"></asp:LinkButton>
                     </ItemTemplate>
                </rad:GridTemplateColumn>
                <rad:GridButtonColumn CommandName="delete" Text="删除" Visible="false">
                </rad:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </rad:RadGrid>    
        
    <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
    </div>
      
    <div style="margin: 5px 0 5px 0">
    </div>
    <table class="mnubar" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td style="padding-left: 5px" nowrap>
                    <b>其他收款</b>
                </td>
                <td style="padding-left: 5px">
                    <img src="../Content/Grid/separator.gif">
                </td>
                <td class="icMenu" nowrap>
                </td>
                <td class="icMenu mnuRight" nowrap>
                </td>
            </tr>
        </tbody>
    </table>
    
    <div style="display: inline" id="divContractOthor" class="tab" runat="server">
    <table width="100%">
    <tr style="background-color:#ccc">
    <td colspan="6">设备收款</td> 
    </tr>
    <tr>
    <td>收费年限</td><td>
        <rad:RadNumericTextBox ID="radtxtMachinePeriod" Runat="server" Skin="Office2007">
            <NumberFormat AllowRounding="True" DecimalDigits="0"></NumberFormat>
            <ClientEvents  OnValueChanged="radtxtMachinePeriod_OnClientValueChanged" />
        </rad:RadNumericTextBox>
        </td><td>每年机器收入</td><td>
        <rad:RadNumericTextBox ID="radtxtMachinePerIncome" Runat="server" Skin="Office2007">
            <NumberFormat AllowRounding="True" DecimalDigits="2"></NumberFormat>
            <ClientEvents  OnValueChanged="radtxtMachinePerIncome_OnClientValueChanged" />
        </rad:RadNumericTextBox>
        </td> 
        <td>机器总收入</td> 
        <td>
            <rad:RadNumericTextBox ID="radtxtMachineTotalIncome" Runat="server" Skin="Office2007">
                    <NumberFormat AllowRounding="True" DecimalDigits="2"></NumberFormat>
            </rad:RadNumericTextBox>
        </td> 
    </tr>
    <tr>
    <td>约定首次缴费日期</td><td>
        <rad:RadDatePicker ID="raddateMachineDate" Runat="server" Skin="WebBlue">
            <DateInput Skin="WebBlue"></DateInput>
            <Calendar Skin="WebBlue"></Calendar>
        </rad:RadDatePicker>
        </td>
        <td>提醒天数</td><td>
                <rad:RadNumericTextBox ID="radtxtAlertDays" Runat="server" Skin="Office2007">
                    <NumberFormat AllowRounding="True" DecimalDigits="0"></NumberFormat>
                </rad:RadNumericTextBox>
        </td> 
        <td>备注</td> 
        <td>
            <asp:TextBox ID="txtMachineRemark" runat="server" CssClass="input"></asp:TextBox>
        </td> 
    </tr>
    <tr style="background-color:#ccc">
    <td colspan="6">保修收款</td>
    </tr>
    <tr>
    <td>收费年限</td><td>
        <rad:RadNumericTextBox ID="radtxtMaintainPeriod" Runat="server" Skin="Office2007">
            <NumberFormat AllowRounding="True" DecimalDigits="0"></NumberFormat>
            <ClientEvents  OnValueChanged="radtxtMaintainPeriod_OnClientValueChanged" />
        </rad:RadNumericTextBox>
        </td><td>每年保修收入</td><td>
        <rad:RadNumericTextBox ID="radtxtMaintainPerIncome" Runat="server" Skin="Office2007">
            <NumberFormat AllowRounding="True" DecimalDigits="2"></NumberFormat>
            <ClientEvents  OnValueChanged="radtxtMaintainPerIncome_OnClientValueChanged" />
        </rad:RadNumericTextBox>
        </td> 
        <td>保修总收入</td> 
        <td>
            <rad:RadNumericTextBox ID="radtxtMaintainTotalIncome" Runat="server" Skin="Office2007">
                    <NumberFormat AllowRounding="True" DecimalDigits="2"></NumberFormat>
            </rad:RadNumericTextBox>
        </td> 
    </tr>
    <tr>
    <td>约定首次缴费日期</td><td>
        <rad:RadDatePicker ID="raddateMaintainDate" Runat="server" Skin="WebBlue">
            <DateInput Skin="WebBlue"></DateInput>
            <Calendar Skin="WebBlue"></Calendar>
        </rad:RadDatePicker>
        </td>
        <td>提醒天数</td><td>
                <rad:RadNumericTextBox ID="radtxtMaintainAlertDays" Runat="server" Skin="Office2007">
                    <NumberFormat AllowRounding="True" DecimalDigits="0"></NumberFormat>
                </rad:RadNumericTextBox>
        </td> 
        <td>备注</td> 
        <td>
            <asp:TextBox ID="txtMaintainRemark" runat="server" CssClass="input"></asp:TextBox>
        </td> 
    </tr>
    <tr style="background-color:#ccc">
    <td colspan="6">租赁收款</td> 
    </tr>
    <tr>
    <td>收费年限</td><td>
        <rad:RadNumericTextBox ID="radtxtRentPeriod" Runat="server" Skin="Office2007">
            <NumberFormat AllowRounding="True" DecimalDigits="0"></NumberFormat>
            <ClientEvents  OnValueChanged="radtxtRentPeriod_OnClientValueChanged" />
        </rad:RadNumericTextBox>
        </td><td>每年租赁收入</td><td>
        <rad:RadNumericTextBox ID="radtxtRentPerIncome" Runat="server" Skin="Office2007">
            <NumberFormat AllowRounding="True" DecimalDigits="2"></NumberFormat>
            <ClientEvents  OnValueChanged="radtxtRentPerIncome_OnClientValueChanged" />
        </rad:RadNumericTextBox>
        </td> 
        <td>租赁总收入</td> 
        <td>
            <rad:RadNumericTextBox ID="radtxtRentTotalIncome" Runat="server" Skin="Office2007">
                    <NumberFormat AllowRounding="True" DecimalDigits="2"></NumberFormat>
            </rad:RadNumericTextBox>
        </td> 
    </tr>
    <tr>
    <td>约定首次缴费日期</td><td>
        <rad:RadDatePicker ID="raddateRentDate" Runat="server" Skin="WebBlue">
            <DateInput Skin="WebBlue"></DateInput>
            <Calendar Skin="WebBlue"></Calendar>
        </rad:RadDatePicker>
        </td>
        <td>提醒天数</td><td>
                <rad:RadNumericTextBox ID="radtxtRentAlertDays" Runat="server" Skin="Office2007">
                    <NumberFormat AllowRounding="True" DecimalDigits="0"></NumberFormat>
                </rad:RadNumericTextBox>
        </td> 
        <td>备注</td> 
        <td>
            <asp:TextBox ID="txtRentRemark" runat="server" CssClass="input"></asp:TextBox>
        </td>
        </tr><tr>
        <td colspan="6" align="center">
            <asp:Button ID="btnSaveIncome" runat="server" Text="保存" CssClass="button"  Visible="false" 
                onclick="btnSaveIncome_Click"/></td>
    </tr>
    </table>
    </div>     
    
        <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
        </div>
        <div style="margin: 5px 0 5px 0">
        </div>
        <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>配套商品</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap>
                    </td>
                    <td class="icMenu mnuRight" nowrap> 
                    </td>
                </tr>
            </tbody>
        </table>
        <rad:RadGrid runat="server" ID="gridContractGift" Skin="OCM" AutoGenerateColumns="False"
            AllowSorting="false" GridLines="None" EnableAJAX="true" AllowPaging="false" EnableAJAXLoadingTemplate="true"
            OnDeleteCommand="gridContractGift_DeleteCommand">
            <AJAXLoadingTemplate>
                <img src="../Images/loadding_orange.gif" />
                加载中...
            </AJAXLoadingTemplate>
            <MasterTableView DataKeyNames="GiftID">
                <Columns>
                    <rad:GridBoundColumn HeaderText="商品编码" DataField="InstrumentCode">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="商品名称" DataField="InstrumentName">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="规格" DataField="instrumentStandard">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="单位" DataField="Unit">
                    </rad:GridBoundColumn>
                    <rad:GridBoundColumn HeaderText="成本" DataField="Cost">
                    </rad:GridBoundColumn>
                    <rad:GridTemplateColumn HeaderText="删除" Visible="false">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkbtnDelete" runat="server" CommandName="delete">删除</asp:LinkButton>
                        </ItemTemplate>
                    </rad:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </rad:RadGrid>
</div>
    <asp:HiddenField ID="txtContractID" runat="server" />
    <asp:HiddenField ID="txtItemID" runat="server" />
    <asp:HiddenField ID="txtItemType" runat="server" />
    <asp:Button ID="btnRefresh" runat="server" Text="刷新"  onclick="btnRefresh_Click" style="display:none" />
    <asp:Button ID="btnRefreshSubItem" runat="server" Text="刷新" OnClick="btnRefreshSubItem_Click" style="display:none"/> 
    <asp:Button ID="btnResreshItemPart" runat="server" Text="刷新" onclick="btnResreshItemPart_Click" Style="display: none"/>
    <asp:Button ID="btnRefreshContractGift" runat="server" Text="刷新" OnClick="btnRefreshContractGift_Click" Style="display: none" />
</asp:Content>
